package com.allwees.data.analysis.stat.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.allwees.bs.core.model.stat.EStatType;
import com.allwees.bs.core.modelbase.constant.EPlatform;
import com.allwees.data.analysis.stat.EStatMode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * Monthly Stat
 *
 * @author yangylsky
 * @since 2020-04-16
 *
 */
@Data
@EqualsAndHashCode(callSuper=false)
@ToString
@Accessors(chain = true)
@TableName("stat_monthly_stat")
public class MonthlyStatEntity extends BaseStatEntity {
	@Override
	protected EStatMode statMode() {
		return EStatMode.MONTHLY;
	}

    public static MonthlyStatEntity ofDefault(EStatType statType, Date date) {
        MonthlyStatEntity monthlyStat = new MonthlyStatEntity();
        monthlyStat.setStatType(statType)
                .setDate(date)
                .setPlatform(EPlatform.H5)
                .setValue(0.0)
                .setUuid(monthlyStat.uniqueId());
        return monthlyStat;
    }
}
